<template>
    <el-dialog title="收货地址" :visible.sync="show">
        <el-form :model="form">
            <el-form-item label="应用名称" :label-width="formLabelWidth">
              <el-input v-model="form.name" placeholder="请输入应用名称"></el-input>
            </el-form-item>
            <el-form-item label="应用代码" :label-width="formLabelWidth">
              <el-input v-model="form.code" placeholder="请输入应用代码"></el-input>
            </el-form-item>
            <slot :data="form"></slot>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="cancel">取 消</el-button>
            <el-button type="primary" @click="confirm">确 定</el-button>
        </div>
    </el-dialog>
</template>

<script>
  export default {
    data() {
      return {
        formLabelWidth: '120px'
      };
    },
    props: ['show', 'form'],
    methods: {
      confirm() {
        this.$emit("onConfirm", this.form);
      },
      cancel() {
        this.$emit("onCancel", this.form);
      }
    }
  };
</script>